package com.dns.server.primary;

import com.dns.util.Constants;

/**
 * this class clears the expired DNS records by removing it from the cache
 * @author Lakshmana s
 *
 */
public class CleanDNSRecords implements Runnable{

	private Address_Lookup lookUp;
	
	public CleanDNSRecords(Address_Lookup lookUp){
		this.lookUp=lookUp;
	}
	
	@Override
	public void run() {
		try{
			Thread.sleep(Constants.TTL_THREAD_SLEEP);
			lookUp.removeExpired();
		} catch (InterruptedException e) {
			System.out.println(this.getClass().getName() +" TTL Thread interupted");
			e.printStackTrace();
		}
	}

}
